var e = require("../../A4730AC3A71FB5DFC21562C4223CA4D1.js");

Component({
    data: {
        isShowModal: !1,
        orderId: null,
        price: 0,
        isFeedback: !1,
        deviceMsg: {},
        time: 0,
        num: 0
    },
    methods: {
        closeModal: function() {
            this.setData({
                isShowModal: !1,
                orderId: null,
                price: 0
            });
        },
        getDeviceMsg: function(d) {
            var a = this;
            this.setData({
                orderId: d.orderId || null,
                price: d.price || 0,
                isFeedback: d.isFeedback || !1
            }, function() {
                wx.showLoading({
                    mask: !0
                });
                var i = {};
                d.deviceId && (i.device_id = d.deviceId), d.orderId && (i.order_id = d.orderId), 
                e.post("/v2/order/product/queueInfor", i).then(function(e) {
                    if (wx.hideLoading(), 1001 === e.data.code) {
                        var d = e.data.response.data;
                        a.setData({
                            deviceMsg: d.device,
                            time: d.time,
                            num: d.num,
                            isShowModal: !0
                        }, function() {
                            d.isUpdate && a.triggerEvent("feedback", {
                                data: d
                            });
                        });
                    }
                }).catch(function() {
                    wx.hideLoading();
                });
            });
        },
        navToPay: function() {
            var e = this;
            this.setData({
                isShowModal: !1
            }, function() {
                e.data.isFeedback ? e.triggerEvent("feedback") : wx.navigateTo({
                    url: "/pages/pay/pay?orderId=" + e.data.orderId + "&price=" + e.data.price
                });
            });
        }
    }
});